package com.netease.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.netease.domain.Commodity;
import com.netease.mapper.CommodityMapper;

@Service
public class CommodityServiceImpl implements CommodityService {
	@Autowired
	private CommodityMapper CommodityMapper;

	@Override
	public List<Commodity> findAllByPage(int pageNo) {
		return CommodityMapper.findAllByPage(pageNo);
	}
	
	@Override
	public List<Commodity> findAll() {
		return CommodityMapper.findAll();
	}

	@Override
	public Commodity findOne(String id) {
		return CommodityMapper.findOne(id);
	}

	@Transactional
	public void save(Commodity info) {
		CommodityMapper.save(info);
	}
	
	@Transactional
	public void update(Commodity info) {
		CommodityMapper.update(info);
	}

	@Override
	public int findCount() {
		return CommodityMapper.findCount();
	}
	
	
	
}
